# -*- coding: utf-8 -*-
"""
Created on Sun Oct  7 17:06:32 2018

@author: Administrator
"""

import math
def prime(n):
  for i in range(2,int(math.sqrt(n))+1,1):
    if n%i==0:
      return False
  return True
n=int(input())
if((n>3)and(n<8) ):
  count = 1
else: 
  count=0
for i in range(2,n+1):
      if prime(i) and prime(i+2) and (i+2<n) :
        count+=1
print(count)